[audioIn,fs] = audioread("stft.wav");

segmentDuration = 1;
frameDuration = 0.025;
hopDuration = 0.010;
FFTLength = 512;
numBands = 50;
segmentSamples = round(segmentDuration*fs)
frameSamples = round(frameDuration*fs)
hopSamples = round(hopDuration*fs)
overlapSamples = frameSamples - hopSamples
	
aFE = audioFeatureExtractor(SampleRate=fs, ...
                            SpectralDescriptorInput="barkSpectrum", ... 
		                    FFTLength=FFTLength,... 
		                    Window=hann(frameSamples,"periodic"),... 
		                    OverlapLength=overlapSamples,...
                            barkSpectrum=true,...
                            spectralCentroid=false);
setExtractorParameters(aFE, "barkSpectrum",...
	NumBands=50,...
	WindowNormalization=true,...
	FilterBankNormalization='bandwidth',...
    FilterBankDesignDomain='warped'	);

f=figure
plotFeatures(aFE,audioIn,parent=f);

saveas(f,"bark-spectrum.jpg");